Onionizing Repositories

The guide explains how to configure experimental Tor onion services for APT repositories. The configuration provides additional security and privacy benefits, such as protection against targeted attacks, man-in-the-middle attacks, and preventing tracking of installed programs, but it may cause system updates to fail due to unreliability.
Note: This page applies to Kicksecure. Kicksecure is not a torifying proxy; this configuration only affects APT repository downloads and does not automatically onionize or torify other system traffic.
Introduction
[edit]When software packages from Debian, Kicksecure, Fedora, Qubes (and others) are downloaded prior to the installation of new packages or upgrades, the package repository sources default to the https transport protocol, which is non-ideal for security. Instead, experimental Tor onion services can be configured for a number of platforms, which provides several security and privacy benefits: [1]
- The user cannot be uniquely targeted for malicious updates -- attackers are forced to attack everyone requesting the update.
- The package repository, or observers watching it, cannot track what programs are installed.
- The ISP cannot easily learn what packages are fetched.
- End-to-end authentication and encryption provides protection against man-in-the-middle attacks, like version downgrade attacks.
Be aware that enabling onion repositories may cause system updates to periodically fail due to their unreliability![]()
. If this becomes an issue, it is encouraged to Re-enable Clearnet Repositories so packages can be updated.
If the term "comment" is unfamiliar, please follow this link![]()
to learn how to comment / uncomment lines in a configuration file.
Onionize Debian Package Sources
[edit]1 Open file /etc/apt/sources.list.d/debian.sources in an editor with administrative ("root") rights.
1 Select your platform.
2 Notes.
- Sudoedit guidance: See Open File with Root Rights for details on why using
sudoeditimproves security and how to use it. - Editor requirement: Close Featherpad (or the chosen text editor) before running the
sudoeditcommand.
3 Open the file with root rights.
sudoedit /etc/apt/sources.list.d/debian.sources
2 Notes.
- Sudoedit guidance: See Open File with Root Rights for details on why using
sudoeditimproves security and how to use it. - Editor requirement: Close Featherpad (or the chosen text editor) before running the
sudoeditcommand. - Template requirement: When using Kicksecure-Qubes, this must be done inside the Template.
3 Open the file with root rights.
sudoedit /etc/apt/sources.list.d/debian.sources
4 Notes.
- Shut down Template: After applying this change, shut down the Template.
- Restart App Qubes: All App Qubes based on the Template need to be restarted if they were already running.
- Qubes persistence: See also Qubes Persistence
- General procedure: This is a general procedure required for Qubes and is unspecific to Kicksecure-Qubes.
2 Notes.
- Example only: This is just an example. Other tools could achieve the same goal.
- Troubleshooting and alternatives: If this example does not work for you, or if you are not using Kicksecure, please refer to Open File with Root Rights.
3 Open the file with root rights.
sudoedit /etc/apt/sources.list.d/debian.sources
2 Enable the onionized Debian repositories and disable the clearnet repositories.
Enable the following .onion mirrors and disable the corresponding https repositories (except the fasttrack repository).
######## ENABLED SOURCES ######## Types: deb URIs: tor+https://deb.debian.org/debian Suites: trixie trixie-updates trixie-backports Components: main contrib non-free non-free-firmware Enabled: no # <<<<< change this line from "yes" to "no" Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: tor+https://deb.debian.org/debian-security Suites: trixie-security Components: main contrib non-free non-free-firmware Enabled: no # <<<<< change this line from "yes" to "no" Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: tor+https://fasttrack.debian.net/debian-fasttrack Suites: trixie-fasttrack trixie-backports-staging Components: main contrib non-free Enabled: yes # <<<<< keep this line saying "yes" Signed-By: /usr/share/keyrings/fasttrack-archive-keyring.gpg ######## DISABLED BY DEFAULT SOURCES ######## #### deb #### Types: deb URIs: tor+http://2s4yqjx5ul6okpp3f2gaunr2syex5jgbfpfvhxxbbjwnrsvbk5v3qbid.onion/debian Suites: trixie trixie-updates trixie-backports Components: main contrib non-free non-free-firmware Enabled: yes # <<<<< change this line from "no" to "yes" Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: tor+http://5ajw6aqf3ep7sijnscdzw77t7xq4xjpsy335yb2wiwgouo7yfxtjlmid.onion/debian-security Suites: trixie-security Components: main contrib non-free non-free-firmware Enabled: yes # <<<<< change this line from "no" to "yes" Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg ## No onion for fasttrack yet: https://salsa.debian.org/fasttrack-team/support/-/issues/27
3 Save and exit.
Onionize Kicksecure APT Sources
[edit]Follow these steps to point the Kicksecure sources file to the onion mirror. See Kicksecure APT Repository overview for details on the four repository choices.
This can be done using repository-dist command line interface (CLI) tool with the --transport onion option.
1 Run the following command:
sudo repository-dist --enable --transport onion
2 Confirm the onionized repository is functional.
upgrade-nonroot
Onionize Tor Project APT Sources
[edit]For enhanced security, advanced users and testers can onionize Tor Project updates; see Tor Versioning for further details.
Qubes
[edit]- Limitation: Kicksecure cannot be used as a torifying proxy for Qubes
dom0or for other templates (for example Debian or Fedora TemplateVM updates). For this use case, use Whonix and see also Whonix wiki page Onionizing Repositories
- Related Qubes upstream issues: Qubes onion APT repository issues:
- dom0 updater behavior / unreachable repos: Qubes dom0 update fails to detect release version

- Template repo content / template confusion: Onion mirror for Qubes templates: Debian 13 not served

- Note: Qubes onion APT repository issues are unspecific to Kicksecure
- dom0 updater behavior / unreachable repos: Qubes dom0 update fails to detect release version
Footnotes
[edit]
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!